*{
  margin: 0;
  padding: 0;
}
.chatContainer {
  height: 100%;
  /* max-height: 100vh; */
  display: flex;
  flex-direction: column;
  max-width: 100vh;
  margin: 0 auto;
  border: 1px solid #f0f0f0;
  background: #fafafa;
}
.out{
  font-size: 20px;
  margin-right: 10px;
}
.chatHeader {
  padding: 12px 16px;
  background: #000000;
  color: white;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e8e8e8;
}

.messageList {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

/* 气泡容器 - 完全动态尺寸 */
.messageBubbleContainer {
  --min-width: 140px;
  --max-width-responsive: 95%;

  margin-bottom: 12px;
  max-width: var(--bubble-width, 80%);
  min-width: var(--min-width);
  width: fit-content;
  transition: all 0.3s ease;
  animation: bubbleAppear 0.2s ease-out;

  &.me {
    align-self: flex-end;
    margin-left: auto;
  }

  &.others {
    align-self: flex-start;
    margin-right: auto;
  }
}

/* 气泡主体 - 完全动态 */
.messageBubble {
  border-radius: 18px;
  padding: var(--bubble-padding, 12px 16px);
  position: relative;
  word-wrap: break-word;

  .me & {
    background: #1890ff;
    color: white;
    border-top-right-radius: 4px;
  }

  .others & {
    background: white;
    color: #333;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

    &:hover {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
  }
  
  .deleteIcon {
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  &:hover .deleteIcon {
    opacity: 0.8;
  }
}

/* 消息元信息 */
.messageSender {
  display: flex;
  align-items: center;
  margin-bottom: 6px;

  .ant-avatar {
    flex-shrink: 0;
  }
}

.senderName {
  margin: 0 8px;
  font-weight: 500;
  font-size: 0.9em;

  .me & {
    color: rgba(255, 255, 255, 0.8);
  }

  .others & {
    color: #666;
  }
}

.messageTime {
  font-size: 0.7em;
  opacity: 0.8;
  /* color: #000; */
}

.messageText {
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 小三角指示器 */
.me .messageBubble::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 16px;
  border-width: 8px 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent #1890ff;
}

.others .messageBubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 16px;
  border-width: 8px 8px 8px 0;
  border-style: solid;
  border-color: transparent white transparent transparent;
}

/* 输入区 */
.inputArea {
  padding: 16px;
  border-top: 1px solid #e8e8e8;
  background: white;
  /* margin-top: -50px; */
}

/* 动画 */
@keyframes bubbleAppear {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 480px) {
  .message-bubble-container {
    --min-width: 80px;
    max-width: var(--max-width-responsive) !important;
  }

  .message-bubble {
    font-size: 0.95em;
  }
}